-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: VoiceWidget (DSN-2548) #370
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Your org requires the Graphite merge queue for merging into masterAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
} else if (isListening) { | ||
title = 'Listening'; | ||
} else if (isTalking) { | ||
title = 'Talk to interupt'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo in the title text - interupt
should be spelled interrupt
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
if (microphone) microphone.disconnect(); | ||
if (audioContext) audioContext.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to:
microphone?.disconnect();
audioContext?.close();
setIsCalling((prev) => !prev); | ||
if (isCalling) { | ||
endCall(); | ||
// End call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant comment.. :/
// End call | ||
} else { | ||
startCall(); | ||
// Start call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant comment.. :/
|
||
const handleButtonClick = () => { | ||
setIsCalling((prev) => !prev); | ||
if (isCalling) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In react (from what I know) we don't have a guarantee as to when a 'set state' method will change the state. (It should happen instantaneously, but sometimes for performance reasons it might not).
So, I would place this if
before the setIsCalling()
method, so it's definitive.
footer: { | ||
extraLinkText: string; | ||
extraLinkUrl: string; | ||
showPoweredBy: boolean; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the same FooterProps
object we have for this ?
|
||
useEffect(() => { | ||
const initAudio = async () => { | ||
if (audioContextRef.current) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should be a dependency of the effect
here if it needs to be triggered when this is changed (and not triggered again after) ?
Fixes or implements VF-XXX
Brief description. What is this change?
Implementation details. How do you make this change?
Setup information
Deployment Notes
Related PRs
Checklist